package com.my.admin.api;

import com.my.admin.service.TagService;
import com.my.admin.util.Rest;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "标签接口", tags = "标签接口")
@RestController
@RequestMapping("api")
@CrossOrigin
public class TagApiController {

    @Autowired
    private TagService service;

    @GetMapping("tag/list")
    public Rest list() {
        return Rest.ok().setData("tags", service.list());
    }

}
